package com.example.gateway.designPattern.builder;

import com.example.gateway.designPattern.builder.Computer;
import com.example.gateway.designPattern.builder.ComputerBuilder;

/**
 * @ClassName: Director
 * @Description:
 * @Author: YourName
 * @Date: 2024/12/30
 */

//指挥者(Director): 负责安排建造顺序
public class Director {
    private final ComputerBuilder computerBuilder;
    public Director(ComputerBuilder computerBuilder) {
        this.computerBuilder = computerBuilder;
    }
    public void constructComputer() {
        computerBuilder.buildComputer();
        computerBuilder.buildMaster();
        computerBuilder.buildScreen();
        computerBuilder.buildKeyboard();
        computerBuilder.buildMouse();
        computerBuilder.buildAudio();
    }
    public Computer getComputer() {
        return computerBuilder.getComputer();
    }
}
